﻿//********************************************************************
// 
//  file:  frmMergeActivityLogs.cs
// 
//  (C) Copyright 2010, Diomede Corporation
//  All rights reserved
// 
//  Use, modification, and distribution is subject to   
//  the New BSD License (See accompanying file license.txt).
// 
//********************************************************************

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Diomede.SDK;

namespace Diomede.Explorer
{
    public partial class frmMergeActivityLogs : Form
    {
        public frmMergeActivityLogs()
        {
            InitializeComponent();
        }

        public frmMergeActivityLogs(ISession session)
        {
            InitializeComponent();
            Session = session;
        }

        public ISession Session { get; set; }

        private void btnSearch_Click(object sender, EventArgs e)
        {
            byte? storageType = null;
            if (cbStorage.SelectedIndex >= 0)
            {
                string[] s = new string[] {"xJ","Online","Nearline","Offline"};
                for (int i = 0; i < s.Length; i++)
                {
                    if (s[i].Equals(cbStorage.SelectedItem))
                    {
                        storageType = (byte)i;
                        break;
                    }
                }

            }

            //ILogsManagement l = Session as ILogsManagement;
            ////ISearchMergeLogsResult result = l.SearchMergedActivityLogs(storageType, dtFrom.Value.Date, dtTo.Value.Date, 0, 100);
            //if (result.Status == Diomede.SDK.Enums.ExecutionResults.Success)
            //{
            //    //dataGrid.DataSource = result.Logs;
            //    //dataGrid.Columns[0].Visible = false;
                
            //}
            //else
            //{
            //    MessageBox.Show(this, result.Message, "Error");
            //}
        }

        private void frmMergeActivityLogs_Load(object sender, EventArgs e)
        {
            
        }
    }
}
